<?php

if (!defined('TOBBIVM'))
	header('location:/template/notrepassing.php');
/**
 * This file is part of TobbiVMShop.
 *
 * TobbiVMShop is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TobbiVMShop is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TobbiVMShop.  If not, see <http://www.gnu.org/licenses/>.
 */
/**
 * create error edit page
 * get: error.editor.tpl.php
 *
 * @version    $Id$
 * @package    TobbiVM-Shop
 * @copyright  Copyright (C) 2015
 * @author     Norbert Gebert
 * @license    GPL3
 */
db::getInstance()->where('error_id', $refValidate->cleanslash($_GET['id']));
$result = db::getInstance()->getOne('error');

if (db::getInstance()->count <= 0)
{
	message::setErrorRow(_('Databaseerror! - Contact Admin!'), true);
}
else
{
	$refPage->assign('pageTitle', _('Edit Errorentry'));

	$refPage->assign('action',	'index2.php?page=' . $page . '&sub=' . $subpage);

	$refPage->assign('id', _('Error-ID') . ': ');
	$refPage->assign('idx',
		'<input type="text" name="idx" id="idx" disabled="disabled" ' .
		'size="8" value="' . $result['error_id'] . '"/>');

	$refPage->assign('date', _('Date') . ': ');
	$refPage->assign('datex',
		'<input type="text" name="namex" id="namex" size="35" value="' .
		$result['error_date'] . '" disabled="disabled"/>');
	$refPage->assign('datexHelp', help('errordate', $page));

	$refPage->assign('textx', stripslashes($result['error_text']));

	$refPage->assign('btnAbort',
		'<input type="submit" name="submit" id="abort" value="' .
		_('Cancel') . '" />');

	$refPage->addtpl('content', '/' . $page . '/' . $subpage . '.editor.tpl.php');
}
?>
